{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Reading and writing molecules 1\n",
    "\n",
    "This is a short overview of creating molecules from and writing molecules to various file formats. It is intended to be a complement to, not replacement for, the contents of the [main RDKit documentation](http://rdkit.org/docs/index.html)\n",
    "\n",
    "@TAGS: #basics #molecule_input "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from rdkit import Chem\n",
    "from rdkit.Chem.Draw import IPythonConsole\n",
    "from rdkit.Chem import Draw\n",
    "# uncomment this if you try the tutorial and end up with low-quality images\n",
    "# IPythonConsole.ipython_useSVG=True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Sun Oct  9 07:11:37 2016\n"
     ]
    }
   ],
   "source": [
    "import time\n",
    "print(time.asctime()) # doctest: IGNORE"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## Working with SMILES"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If you have a SMILES string, the easiest thing to use is MolFromSmiles:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAAABmJLR0QA/wD/AP+gvaeTAAAgAElE\nQVR4nO3dd1xTV/8H8G9CgDBFIILiLMpWnLQ4KlUQ63hqrdQ64mOtxY040VaNW6wr1jp4Wm1RUUv7\nahW1PlZ4LOVXV7UORmUIVEFApgyBkOT7++PSCGHIuLknSc/75R+ac8n9EMOXk3PPOZeHiEBRFEW1\nFZ90AIqiKN1GyyhFUVS70DJKURTVLrSMUhRFtQstoxRFUe1CyyhFUVS70DJKURTLzp8/379//6ys\nLNJBOEL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YpKSki\nkYjrZJpHyyhF6Y/0dHBzA5kMYmPh73uAceT58+dbtmwRiUQhzELUv9XU1PTr1+/hw4e7d+9m9ufX\nP7SMUpReWbMGdu6EgQPh99+BrwWDdvv37w8ODnZycoqPjzcyMiIdRyNoGaUovVJWBs7OkJMDx47B\nhx8SDlNQUODk5FRcXBwVFTVx4kTCaTRGC35bURTFHgsL2LgRACAignASAJBIJMXFxWPHjtXjGgq0\nN0pR+kehgK++gg8/BLKfoePj4wcMGMDn8+/fv+/q6koyioYJSAegKIplBgZkNsdTExwcrFAoFixY\noN81FGhvlKL0Eo8H/v5w6RLwePUe5OzH/dy5c5MmTbKxsUlNTe3YsSNHZyWEjo1SlH6ytoaDB8mc\nurq6evny5QAgkUj0voYC7Y1SlF7i8aC4GN54A86eBReXlw8iwn/+A+nprX22nUVFrfiahISEa9eu\nOTs7x8fHGxoatu5kOoiOjVKUfrKygiNHQCyGa9egbik7fRp++aV1T+XhcS4h4XqrvmTq1KmzZs36\nJ9RQoL1RitJLqmHQ1atBIIDt218+ePp0qxfdi0Tn5PK8Vn3J5MmTbbnZVEoL0DJKUXpIVUZlMhg6\nFKRSGD6c00tM/yi0jFKUHqpbMZOSYMoUuHkTLC1pGdUIeqWeovScmxvMnw9LlpDOob9oGaUo/bdk\nCeTmkg6hv+iHeoqiqHahvVGKoqh2+X+fHpAHGRcgDgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x7f0b336dd620>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m = Chem.MolFromSmiles('COc1ccc2c(c1)[nH]c(n2)[S@@](=O)Cc1ncc(c(c1C)OC)C')\n",
    "m"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "Note that the coordinates used for the drawing are not present in the molecule, the RDKit generates them when the molecule is drawn."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Reading Mol file data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAAABmJLR0QA/wD/AP+gvaeTAAAQ9ElE\nQVR4nO3da1BTd/oH8CchgFxERLxgUVsuliL1Akio2qqFtozAtnaavguvdtNx2sad2bZxHWeO+qJi\nx+mEFzvbvHBnM860M3Fmt0aL3WJBqyCCtypixeANUARBkTsh+f1fHP9IEW3knJNzTvL9TF9ohCdP\nZfgm58d5HjWMMQIAgKnSyt0AAIC6IUYBFMBup9xcio6m6GjKzaV///t3f6rRTP5ZT3sc/EsndwMA\nQW/TJjp5kkpLac0a0miouposFjp1iv75T7k7A59ocDYKIKcDB+jvf6e6OoqOfvxgXx+tXEm7d9Of\n/kREpNHQpN+nT3sc/AsX9QCy+uYb4rjfZSgRRUcTx9E338jUEzwfxChMRUdHR0lJyfvvv7948eKy\nsjKPxyN3R6pVX0/r10/y+Lp1VF/v925gKnBRD8/H6/Xu3bt327ZtHR0dWq3W6/USkV6vLysr0+v1\ncnenQjodDQ2R7omfUrjdFBlJbjfRM3+UhO9fBcC7UXgO5eXl6enpJpOpo6Njw4YNjY2NTqfzpZde\nOnXqVG5ubnFx8fXr1+XuUW1iY6m7e5LHu7spNvbxbxmb5D9QBsQo+KSxsfGtt94qLCy8cuVKenp6\nRUXFDz/88PLLLxcXF1+6dKm0tHT69OmHDh1KS0vbvHlzb2+v3P2qR3Y2VVVN8nhVFWVn+70bmBIG\n8EwPHjwwm82hoaFENGPGDKvVOjIy8uSHtbW1mUwmrVZLRPPnz7fZbB6Px//dqs9//sPS01lf3+8e\n7Otj6ensv/999NunfZ/i+1cZ8GWApxodHbVarbNmzSKikJAQs9l87969Z39KXV3dqlWr+Ffo7Ozs\n6upq/7Sqbn/+M8vMZP/7H+vrY/39rKKCZWayv/zl8QcgRpUNXwaY3LFjx1asWMEH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wUpeakLl68\nmJ+fzwfokiVLKioqpHsuAIEQowFLurV7jY2NBQUFtbW1olSbgF9tFxoaitV2oBaI0QCnosF5rLYD\nlUKMBj5VDM7/+OOPWG0HKoUYDRbSrd0TCKvtQO0Qo8FFUYPz41fbTZ8+HavtQKUQo8Fo/OC8Xq+X\n6IdFz8Cvtps/fz5W20EAQIwGKRkH50+cOJGdnY3VdhAwEKNBTbq1e5O6efMmVttB4EGMgoRr98YM\nDg5itR0EKsQoPCLR2r0nV9vdunVLlMoACoEYhcdEX7t3/vz58avtqqqqROoUQEEQozCRKGv3xq+2\nmzNnDlbbQQBDjMLkJqzdO3z4sI+fiNV2EGwQo/Asz7t27+DBg+NX2125csU/fQLICDEKf8DHtXsN\nDQ1YbQfBCTEKPnly7d7YWef41XaxsbFWqxWr7SCoaBhjBOCbM2fObN68ubq6moiysrK+/vrrc+fO\n7dy5s7u7OyQk5OOPP+Y4jt90BxA8EKPwfLxe7969e7dt29bR0aHVar1eLxHp9fqysjK9Xi93dwAy\nQIzCVAwMDHz11VctLS1NTU1ffPFFcXGx3B0ByAYxCgAgiFbuBgAA1A0xCgAgCGIUAEAQxCgAgCCI\nUQAAQf4PC9kr8BbZ8O0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x7f0b336dd530>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "molblock = \"\"\"phenol\n",
    "  Mrv1682210081607082D          \n",
    "\n",
    "  7  7  0  0  0  0            999 V2000\n",
    "   -0.6473    1.0929    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "   -1.3618    0.6804    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "   -1.3618   -0.1447    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "   -0.6473   -0.5572    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "    0.0671   -0.1447    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "    0.0671    0.6804    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "    0.7816    1.0929    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "  1  2  1  0  0  0  0\n",
    "  2  3  2  0  0  0  0\n",
    "  3  4  1  0  0  0  0\n",
    "  4  5  2  0  0  0  0\n",
    "  5  6  1  0  0  0  0\n",
    "  1  6  2  0  0  0  0\n",
    "  6  7  1  0  0  0  0\n",
    "M  END\n",
    "\"\"\"\n",
    "m = Chem.MolFromMolBlock(molblock)\n",
    "m"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here the molecule has coordinates that were read in from the Mol block. We can see this because the molecule has a conformer:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m.GetNumConformers()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The conformer that is present is 2D (we can see that from the coordinates above):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m.GetConformer().Is3D()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here's another Mol block and the corresponding molecule:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAAABmJLR0QA/wD/AP+gvaeTAAAXbElE\nQVR4nO3daVRU5xkH8AcIOxhmABHFuERNSmrVaBQEQeJKxLhlZFgGbXKi8QvantSlJx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lZWVsUdeeeWV9evXjzZP2cao\nra2tWq1mN+8Dr7js7+9/6tQpjE4C88L1chiEht3vz5o1q/9vbMqUKSPf76emphJRcHAw+2VjY+Pa\ntWuJyNraOi4uzvRnsAK8EGIUjIXN05kzZ44qT3/7298SUVxcHMMwmZmZPj4+ROTu7p6ammq60gFG\nA5t6MDp2v5+cnFxeXs4emTp16rvvviuRSAIDAwfdef78+QUFBVevXs3MzGQ38kuWLDl58iSbpwBm\nCDEKpsPmaVJS0v3799kjg/JUrVZ7eHjY2dktWrQoIyODHZ20f/9+Xo9CAcFDjAIHns3TadOmrV27\n1tvbe9++fba2tt3d3d7e3snJyQPfrAcwT4hR4Exvb296erpCofjmm28aGhoG3oSNPPAIYhS419fX\nd+PGDYVC8e9//zs4OFgsFsfHx5vDNU8BRgIxCmakp6cH6Qm8gxgFANCLNdcFAADwG2IUAEAviFEA\nAL0gRgEA9PJfr3ZrGz4eCZ0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x7f0b336f1120>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "molblock2 ='''cyclopropanol-3D\n",
    "  Mrv1682210081607153D          \n",
    "\n",
    " 10 10  0  0  0  0            999 V2000\n",
    "    0.9159    1.2233    0.2286 C   0  0  1  0  0  0  0  0  0  0  0  0\n",
    "   -0.0738    1.2748   -0.9428 C   0  0  2  0  0  0  0  0  0  0  0  0\n",
    "   -0.3167    0.3104    0.2232 C   0  0  2  0  0  0  0  0  0  0  0  0\n",
    "   -1.3658    0.6623    1.1190 O   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "    1.8730    0.7413    0.0155 H   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "    0.8835    2.0739    0.9139 H   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "    0.2747    0.8266   -1.8737 H   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "   -0.7163    2.1557   -0.9817 H   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "   -0.1264   -0.7446    0.0137 H   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "   -1.1210    0.2486    1.9735 H   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "  1  2  1  0  0  0  0\n",
    "  2  3  1  0  0  0  0\n",
    "  1  3  1  0  0  0  0\n",
    "  3  4  1  0  0  0  0\n",
    "  1  5  1  0  0  0  0\n",
    "  1  6  1  0  0  0  0\n",
    "  2  7  1  0  0  0  0\n",
    "  2  8  1  0  0  0  0\n",
    "  3  9  1  0  0  0  0\n",
    "  4 10  1  0  0  0  0\n",
    "M  END\n",
    "'''\n",
    "m2 = Chem.MolFromMolBlock(molblock2)\n",
    "m2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The odd coordinates in the drawing is because the molecule has a 3D conformer:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m2.GetConformer().Is3D()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice that no Hs were drawn even though there are clearly H atoms in the Mol block. The default behavior for the RDKit Mol block reader is to remove Hs from the input molecule. If we want to keep the Hs and their coordinates, this behavior can be turned off:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAAABmJLR0QA/wD/AP+gvaeTAAASVUlE\nQVR4nO3de1BUdRsH8GeX28IuCwTirFqgkOa6sIWXdAYcNXOosck0LqLSRUOycXOmi+aMruOrhTpj\npBbi5R1xvCA0vr2kZb1TkCRo4CSCKKEIiYCAcltYFmHP+8cpMuK2u+fsYXe/n+mP7ey5PIzLl9/l\n7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BoFx4QYBc6gNQqOCVNMdkXYlXvb\n29vlcrmLi0tbW5uLiwvflwMYIdAatSsDZaV1/lhKpdIJEyYYDAb2waMADgIxClxSq9WEfj04GMQo\ncImdZSouLha6EADrQYwCl9hZpqKiIqELAbAexChwCZP14IAwUw9cYhjG29u7tbW1oaHBz89P6HIA\nrAGtUeCSSCRSqVSE4VFwJIhR4Bj69eBoEKPAMXwlFBwNYhQ4htYoOBpMMQHHWltbvb29JRJJW1ub\nk5OT0OUA8A6tUeCYXC4PDAzU6/Xl5eVC1wJgDYhR4B769eBQEKPAPTZGcc8TOAjEKHCPnazHV0LB\nQSBGgXvo1INDwUw9cK+np0cul+v1+gcPHnh7ewtdDgC/0BoF7jk5OalUKoZhMDwKjgAxCrxAvx4c\nB2IUeIGvhILjQIwCL9AaBceBKSbgxYMHD3x9faVSaWtrq1iMv9Zgz/D5Bl489thjjz/+eHt7e0VF\nhdC1APALMQp8Qb8eHARiFPiCGAUHgRgFvmCyHhwEYhT4olarCTEKDgAz9cCX7u5uT09Pg8HQ3Nws\nl8uFLgeAL2iNAl+cnZ2VSiXDMNeuXRO6FgAeIUaBR5hlAkeAGAUeYZYJHAFiFHiE1ig4AkwxAY8a\nGhr8/f29vLyamppEIpHQ5QDwwlnoAsCejRo1Ki4ubty4cQaDQSKRCF0OAC/QGgUAsAjGRgEALIIY\nBb4MNBiKQVKwM4hRAACLIEYBACyCGAUAsAhiFADAIrhvFHiE2SRwBIhR4FG/dyUjW8HOoFMPAGAR\nxCgAgEUQowAAFkGMAgBY5P9XswKfyLvCHAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x7f0b336f13f0>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m2_h = Chem.MolFromMolBlock(molblock2,removeHs=False)\n",
    "m2_h"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Reading PDB data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This time we'll read from a file instead of embedding the text in the notebook. We also won't try to display the molecule itself, since that isn't particularly informative for a large molecule."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "327"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "crn = Chem.MolFromPDBFile('../data/1CRN.pdb')\n",
    "crn.GetNumAtoms()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In order to be able to show something useful with the proteins, let's get the amino-acid sequence:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(1, 'THR'),\n",
       " (1, 'THR'),\n",
       " (1, 'THR'),\n",
       " (1, 'THR'),\n",
       " (1, 'THR'),\n",
       " (1, 'THR'),\n",
       " (1, 'THR'),\n",
       " (2, 'THR'),\n",
       " (2, 'THR'),\n",
       " (2, 'THR')]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# get the residue information for each atom:\n",
    "residues = [atom.GetPDBResidueInfo() for atom in crn.GetAtoms()]\n",
    "# and now the number and name of each residue\n",
    "resinf = [(res.GetResidueNumber(),res.GetResidueName()) for res in residues]\n",
    "# take a look at those:\n",
    "resinf[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "46"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# and get the ordered list of actual residues:\n",
    "residues = sorted(set(resinf))\n",
    "len(residues)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(1, 'THR'), (2, 'THR'), (3, 'CYS'), (4, 'CYS'), (5, 'PRO')]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "residues[:5]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Reading other sequence formats"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also create molecules from a few sequence formats:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "327"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "seq = 'TTCCPSIVAR SNFNVCRLPG TPEAICATYT GCIIIPGATC PGDYAN'\n",
    "m = Chem.MolFromSequence(seq)\n",
    "m.GetNumAtoms()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "327"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "helm = 'PEPTIDE1{T.T.C.C.P.S.I.V.A.R.S.N.F.N.V.C.R.L.P.G.T.P.E.A.I.C.A.T.Y.T.G.C.I.I.I.P.G.A.T.C.P.G.D.Y.A.N}$$$$'\n",
    "m = Chem.MolFromHELM(helm)\n",
    "m.GetNumAtoms()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "327"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fasta =\"\"\">\n",
    "TTCCPSIVARSNFNVCRLPGTPEAICATYTGCIIIPGATCPGDYAN\n",
    "\"\"\"\n",
    "m = Chem.MolFromFASTA(fasta)\n",
    "m.GetNumAtoms()"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
